package com.kfm.am;

import java.util.regex.Pattern;

public class StringTest {

    public static void main(String[] args) {
        //
        String pattern = "\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}";
        String idPattern = "\\d{17}[\\d|x,X]";
        String qqPattern = "[1-9]([0-9]{4,10})";
        String phonePattern = "0?(13|14|15|18|17)[0-9]{9}";

        String str = "wxlp0323@gmail.com";
        System.out.println(str.matches(pattern));

        boolean matches = Pattern.matches(pattern, str);
        System.out.println(matches);

//        String id = "12345678901234567X";
//        System.out.println(id.matches(idPattern));
//
//        String qq = "1300343646";
//        System.out.println(qq.matches(qqPattern));
//
//        String phone = "018829050445";
//        System.out.println(phone.matches(phonePattern));

    }
}
